const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    username: String, 
    openid: String,
    touxiang: String,
    currentJindu: {
        type: Number,
        default: 0
    },
    chexing: {
        type: String,
        default: 'xiaoche'
    },
    kemu: {
        type: String,
        default: 'keyi'
    },
    moni:[
        {
            time: String,
            score: Number
        }
    ]
})

if (!schema.options.toObject) schema.options.toObject = {};
schema.options.toObject.transform = function (doc, ret, options) {
  return ret
}

module.exports = mongoose.model('Wxsuser', schema)